<script>
	export default {
		onLaunch: function() {
			// if (!uni.getStorageSync('userId')) {
			// 	uni.reLaunch({
			// 		url: '/pages/Sign_in/Sign_in'
			// 	})
			// }

			let that = this

			plus.push.setAutoNotification(true)

			//【APP在线】，收到透传消息通过，不会提醒至通知栏目，需要发送本地消息，再进行点击触发的点击事件。    
			//【APP离线】，收到离线透传消息，必须通过Java后台的Intent字符串携带payload，且符合格式才能触发click事件，格式不符合不会触发+
			 
			  
			plus.push.addEventListener("click", function(msg) {
				console.log(msg);
				var payload;
				console.log("addEventListener click:" + JSON.stringify(msg));
				if (uni.getSystemInfoSync().platform == 'ios') {
					console.log('IOS?')
					//APP离线点击包含click属性，这时payload是JSON对象 
					if (msg.type && msg.type == "click") {
						if (msg.payload.type == 1) {
							uni.navigateTo({
								url: "/pages/receiving_orders/receiving_orders?id=" + msg.payload.id
							})
						} else if (msg.payload.type == 2) {
							uni.navigateTo({
								url: "/pages/information_collection_two/information_collection_two?id=" + msg.payload.id
							})
						} else if (msg.payload.type == 3) {
							uni.navigateTo({
								url: "/pages/maintenance_record/maintenance_record"
							})
						} else if (msg.payload.type == 4) {
							uni.navigateTo({
								url: "/pages/car_sales_consultation/car_sales_consultation"
							})
						} else if (msg.payload.type == 5) {
							uni.navigateTo({
								url: "/pages/on_site_inspection/on_site_inspection"
							})
						} else if (msg.payload.type == 6) {
							uni.navigateTo({
								url: "/pages/purchase_information_details/purchase_information_details?id=" + msg.payload.id
							})
						}
					} else {
						//APP在线，收到消息不会包含type属性,这时的payload是JSON字符串，需要转为JSON对象 
						payload = JSON.parse(msg.payload);
					}
					//navigateTo(payload)
				} else {
					console.log('安卓?');
					console.log(msg);
					console.log(msg.payload.type);
					if (msg.payload.type == 1) {
						uni.navigateTo({
							url: "/pages/receiving_orders/receiving_orders?id=" + msg.payload.id
						})
					} else if (msg.payload.type == 2) {
						uni.navigateTo({
							url: "/pages/information_collection_two/information_collection_two?id=" + msg.payload.id
						})
					} else if (msg.payload.type == 3) {
						uni.navigateTo({
							url: "/pages/maintenance_record/maintenance_record"
						})
					} else if (msg.payload.type == 4) {
						uni.navigateTo({
							url: "/pages/car_sales_consultation/car_sales_consultation"
						})
					} else if (msg.payload.type == 5) {
						uni.navigateTo({
							url: "/pages/on_site_inspection/on_site_inspection"
						})
					} else if (msg.payload.type == 6) {
						uni.navigateTo({
							url: "/pages/purchase_information_details/purchase_information_details?id=" + msg.payload.id
						})
					}
				}
			}, false);

			plus.push.addEventListener('receive', function(msg) {
				//console.log("addEventListener receive:" + JSON.stringify(msg));
				console.log(msg,'推送的消息');
				console.log(msg.payload, '推送payload');
				if (uni.getSystemInfoSync().platform == 'ios') {
					//【APP离线】收到消息，但没有提醒（发生在一次收到多个离线消息时，只有一个有提醒，但其他的没有提醒）    
					//【APP在线】收到消息，不会触发系统消息,需要创建本地消息，但不能重复创建。必须加msg.type验证去除死循环     
					if (!msg.aps && msg.type == "receive") {
						//创建本地消息,发送的本地消息也会被receive方法接收到，但没有type属性，且aps是null    
						plus.push.createMessage(msg.content, JSON.stringify(msg.payload), {
							title: msg.title
						});
					}
				} else {
					//如果是Android，当APP在线时，收到透传消息不会进入系统消息，需要发送本地提醒。
					console.log('准备转到通知栏');
					console.log(JSON.stringify(msg.payload), '我是字符串的payload');
					plus.push.createMessage(msg.title, JSON.stringify(msg.payload), {
						title: msg.title,
						content: msg.content
					});
					console.log('结束推送到通知');
				}
			});

		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		}
	}
</script>

<style lang="scss">
  /* 注意要写在第一行，同时给style标签加入lang="scss"属性 */
  @import "uview-ui/index.scss";
	/*每个页面公共css */
	view,
	image,
	button,
	text,
	input,
	textarea,
	swiper,
	scroll-view {
		-webkit-box-sizing: border-box;
		box-sizing: border-box;
	}

	.flex_box {
		display: -webkit-box;
		display: -webkit-flex;
		display: flex;
		width: 100%;
	}

	.flex_box .item {
		display: block;
		-webkit-box-flex: 1;
		-webkit-flex: 1;
		flex: 1;
	}

	/**flex 设置**/
	.fldr {
		flex-direction: row;
		-webkit-flex-direction: row;
	}

	.fldc {
		flex-direction: column;
		-webkit-flex-direction: column;
	}

	.fldrr {
		flex-direction: row-reverse;
		-webkit-flex-direction: column-reverse
	}

	.jcsb {
		justify-content: space-between;
		-webkit-justify-content: space-between;
	}

	.jcsba {
		justify-content: space-around;
		-webkit-justify-content: space-around;
	}

	.jcfs {
		justify-content: flex-start;
		-webkit-justify-content: flex-start;
	}

	.jcc {
		justify-content: center;
		-webkit-justify-content: center
	}

	.jcfe {
		justify-content: flex-end;
		-webkit-justify-content: flex-end
	}

	.df {
		display: -webkit-flex;
		display: flex
	}

	.dif {
		display: inline-flex;
	}

	.aic {
		align-items: center;
	}

	.jcc {
		justify-content: center;
	}

	.fw {
		flex-wrap: wrap;
		-webkit-flex-wrap: wrap;
	}

	.clamp_1 {
		display: -webkit-box;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 1;
		text-overflow: ellipsis;
		display: box;
		box-orient: vertical;
		line-clamp: 1;
		overflow: hidden;
	}

	.clamp_2 {
		display: -webkit-box;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 2;
		text-overflow: ellipsis;
		display: box;
		box-orient: vertical;
		line-clamp: 2;
		overflow: hidden;
	}

	.clamp_3 {
		display: -webkit-box;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 3;
		text-overflow: ellipsis;
		display: box;
		box-orient: vertical;
		line-clamp: 3;
		overflow: hidden;
	}

	.clamp_4 {
		display: -webkit-box;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 4;
		text-overflow: ellipsis;
		display: box;
		box-orient: vertical;
		line-clamp: 4;
		overflow: hidden;
	}

	.box_pack {
		display: -webkit-box;
		-webkit-box-orient: horizontal;
		-webkit-box-pack: center;
		-webkit-box-align: center;
		display: box;
		box-orient: horizontal;
		box-pack: center;
		box-align: center;
	}

	.box_pack_ver {
		display: -webkit-box;
		-webkit-box-orient: vertical;
		-webkit-box-pack: center;
		-webkit-box-align: center;
		display: box;
		box-orient: vertical;
		box-pack: center;
		box-align: center;
	}

	.ell {
		white-space: nowrap;
		text-overflow: ellipsis;
		overflow: hidden;
	}

	.vm {
		vertical-align: middle;
	}

	.vt {
		vertical-align: top;
	}

	/**字体**/
	.fs0 {
		font-size: 0;
	}

	.fs12 {
		font-size: 12rpx;
	}

	.fs14 {
		font-size: 14rpx;
	}

	.fs16 {
		font-size: 16rpx;
	}

	.fs18 {
		font-size: 18rpx;
	}

	.fs20 {
		font-size: 20rpx;
	}

	.fs22 {
		font-size: 22rpx;
	}

	.fs24 {
		font-size: 24rpx;
	}

	.fs26 {
		font-size: 26rpx;
	}

	.fs28 {
		font-size: 28rpx;
	}

	.fs30 {
		font-size: 30rpx;
	}

	.fs32 {
		font-size: 32rpx;
	}

	.fs34 {
		font-size: 34rpx;
	}

	.fs36 {
		font-size: 36rpx;
	}

	.fs38 {
		font-size: 38rpx;
	}

	.fs40 {
		font-size: 40rpx;
	}

	.fs42 {
		font-size: 42rpx;
	}

	.fs44 {
		font-size: 44rpx;
	}

	.fs46 {
		font-size: 46rpx;
	}

	.fs48 {
		font-size: 48rpx;
	}

	.fs50 {
		font-size: 50rpx;
	}

	.fs54 {
		font-size: 54rpx;
	}

	.fs60 {
		font-size: 60rpx;
	}

	.fs66 {
		font-size: 66rpx;
	}

	.fs68 {
		font-size: 68rpx;
	}

	.fs70 {
		font-size: 70rpx;
	}

	.fs84 {
		font-size: 84rpx;
	}

	.fs100 {
		font-size: 100rpx;
	}

	/* 行高 */
	.lh1 {
		line-height: 1
	}

	.lh50 {
		line-height: 50rpx;
	}

	.lh44 {
		line-height: 44rpx;
	}

	.lh38 {
		line-height: 38rpx;
	}

	.lh36 {
		line-height: 36rpx;
	}

	.lh34 {
		line-height: 34rpx;
	}

	.lh32 {
		line-height: 32rpx;
	}

	.lh26 {
		line-height: 26rpx;
	}

	/**距离 marging **/
	.mt5 {
		margin-top: 5rpx;
	}

	.mt10 {
		margin-top: 10rpx;
	}

	.mt15 {
		margin-top: 15rpx;
	}

	.mt20 {
		margin-top: 20rpx;
	}

	.mt25 {
		margin-top: 25rpx;
	}

	.mt30 {
		margin-top: 30rpx;
	}

	.mt35 {
		margin-top: 35rpx;
	}

	.mt40 {
		margin-top: 40rpx;
	}

	.mt45 {
		margin-top: 45rpx;
	}

	.mt50 {
		margin-top: 50rpx;
	}

	.mt55 {
		margin-top: 55rpx;
	}

	.mt60 {
		margin-top: 60rpx;
	}

	.mt78 {
		margin-top: 78rpx;
	}

	.mt90 {
		margin-top: 90rpx;
	}

	.mt160 {
		margin-top: 160rpx;
	}

	.mb5 {
		margin-bottom: 5rpx;
	}

	.mb10 {
		margin-bottom: 10rpx;
	}

	.mb15 {
		margin-bottom: 15rpx;
	}

	.mb20 {
		margin-bottom: 20rpx;
	}

	.mb25 {
		margin-bottom: 25rpx;
	}

	.mb30 {
		margin-bottom: 30rpx;
	}

	.mb35 {
		margin-bottom: 35rpx;
	}

	.mb40 {
		margin-bottom: 40rpx;
	}

	.mb45 {
		margin-bottom: 45rpx;
	}

	.mb50 {
		margin-bottom: 50rpx;
	}

	.ml5 {
		margin-left: 5rpx;
	}

	.ml10 {
		margin-left: 10rpx;
	}

	.ml15 {
		margin-left: 15rpx;
	}

	.ml20 {
		margin-left: 20rpx;
	}

	.ml25 {
		margin-left: 25rpx;
	}

	.ml30 {
		margin-left: 30rpx;
	}

	.ml35 {
		margin-left: 35rpx;
	}

	.ml40 {
		margin-left: 40rpx;
	}

	.ml45 {
		margin-left: 45rpx;
	}

	.ml50 {
		margin-left: 50rpx;
	}

	.mr5 {
		margin-right: 5rpx;
	}

	.mr10 {
		margin-right: 10rpx;
	}

	.mr15 {
		margin-right: 15rpx;
	}

	.mr17 {
		margin-right: 17rpx;
	}

	.mr20 {
		margin-right: 20rpx;
	}

	.mr25 {
		margin-right: 30rpx;
	}

	.mr30 {
		margin-right: 30rpx;
	}

	.mr35 {
		margin-right: 35rpx;
	}

	.mr40 {
		margin-right: 40rpx;
	}

	.mr45 {
		margin-right: 45rpx;
	}

	.mr50 {
		margin-right: 50rpx;
	}

	.mar_auto {
		margin-left: auto;
		margin-right: auto;
	}

	.pa15 {
		padding: 15rpx;
	}

	.pa20 {
		padding: 20rpx;
	}

	.pa25 {
		padding: 25rpx;
	}

	.pa30 {
		padding: 30rpx;
	}

	.pa35 {
		padding: 35rpx;
	}

	.pt5 {
		padding-top: 5rpx;
	}

	.pt10 {
		padding-top: 10rpx;
	}

	.pt15 {
		padding-top: 15rpx;
	}

	.pt20 {
		padding-top: 20rpx;
	}

	.pt25 {
		padding-top: 25rpx;
	}

	.pt30 {
		padding-top: 30rpx;
	}

	.pt35 {
		padding-top: 35rpx;
	}

	.pt40 {
		padding-top: 40rpx;
	}

	.pt45 {
		padding-top: 45rpx;
	}

	.pt50 {
		padding-top: 50rpx;
	}

	.pb5 {
		padding-bottom: 5rpx;
	}

	.pb10 {
		padding-bottom: 10rpx;
	}

	.pb15 {
		padding-bottom: 15rpx;
	}

	.pb20 {
		padding-bottom: 20rpx;
	}

	.pb25 {
		padding-bottom: 25rpx;
	}

	.pb30 {
		padding-bottom: 30rpx;
	}

	.pb35 {
		padding-bottom: 35rpx;
	}

	.pb40 {
		padding-bottom: 40rpx;
	}

	.pb45 {
		padding-bottom: 45rpx;
	}

	.pb50 {
		padding-bottom: 50rpx;
	}

	.pl5 {
		padding-left: 5rpx;
	}

	.pl10 {
		padding-left: 10rpx;
	}

	.pl15 {
		padding-left: 15rpx;
	}

	.pl20 {
		padding-left: 20rpx;
	}

	.pl25 {
		padding-left: 25rpx;
	}

	.pl30 {
		padding-left: 30rpx;
	}

	.pl35 {
		padding-left: 35rpx;
	}

	.pl40 {
		padding-left: 40rpx;
	}

	.pl45 {
		padding-left: 45rpx;
	}

	.pl50 {
		padding-left: 50rpx;
	}

	.pr5 {
		padding-right: 5rpx;
	}

	.pr10 {
		padding-right: 10rpx;
	}

	.pr15 {
		padding-right: 15rpx;
	}

	.pr20 {
		padding-right: 20rpx;
	}

	.pr25 {
		padding-right: 25rpx;
	}

	.pr30 {
		padding-right: 30rpx;
	}

	.pr35 {
		padding-right: 35rpx;
	}

	.pr40 {
		padding-right: 40rpx;
	}

	.pr45 {
		padding-right: 45rpx;
	}

	.pr50 {
		padding-right: 50rpx;
	}

	.bgf {
		background-color: #fff;
	}

	.cor_666 {
		color: #666;
	}

	.cor_999 {
		color: #999;
	}

	.cor_333 {
		color: #333;
	}

	.cor_000 {
		color: #000;
	}

	.cor_fff {
		color: #fff;
	}

	.cor_F23 {
		color: #F23A3A;
	}

	.cor_808 {
		color: #808080;
	}

	.cor_5D5 {
		color: #5D5D5D;
	}

	.cor_f15 {
		color: #f15a24;
	}

	.cor_5c3 {
		color: #5c3a07;
	}

	.cor_976 {
		color: #976a2e;
	}

	.cor_ED3 {
		color: #ED3726;
	}

	.cor_201 {
		color: #201F1F;
	}

	.cor_007 {
		color: #0078FF;
	}

	.cor_B2B {
		color: #B2B2B2;
	}

	.cor_FFA {
		color: #FFA42D;
	}

	.cor_ada {
		color: #adadad;
	}

	.fwb {
		font-weight: bold;
	}

	.re {
		position: relative;
	}

	.dn {
		display: none;
	}

	.vh {
		visibility: hidden;
	}

	.scaley_1 {
		position: relative;
	}

	.scaley_1:after {
		position: absolute;
		bottom: 0;
		left: 0;
		right: 0;
		background: #eeeded;
		content: '';
		height: 1px;
		-webkit-transform: scaleY(.5);
		transform: scaleY(.5);
	}

	.wp100 {
		width: 100%;
	}

	.wp33 {
		width: 33.33%;
	}

	.wp25 {
		width: 25%;
	}

	.hp100 {
		height: 100%;
	}

	.h62 {
		height: 62rpx;
	}

	.w185 {
		width: 185rpx;
	}

	.w170 {
		width: 170rpx;
	}

	.w157 {
		width: 157rpx;
	}

	.tal {
		text-align: left;
	}

	.tac {
		text-align: center;
	}

	.tar {
		text-align: right;
	}

	.ov {
		overflow: hidden;
	}

	.bb1 {
		border-bottom: 2rpx solid #b8b8b8;
	}

	.img1 {
		width: 82rpx;
		height: 82rpx;
	}

	.img2 {
		width: 350rpx;
		height: 270rpx;
	}

	.img3 {
		width: 20rpx;
		height: 20rpx;
	}

	.img4 {
		width: 40rpx;
		height: 40rpx;
	}

	.img5 {
		width: 28rpx;
		height: 28rpx;
	}

	.img6 {
		width: 19rpx;
		height: 36rpx;
	}

	.img7 {
		width: 26rpx;
		height: 26rpx;
	}

	.img8 {
		width: 22rpx;
		height: 22rpx;
	}

	.img9 {
		width: 64rpx;
		height: 64rpx;
	}

	.img10 {
		width: 48rpx;
		height: 48rpx;
	}

	.img11 {
		width: 24rpx;
		height: 24rpx;
	}

	.img12 {
		width: 128rpx;
		height: 128rpx;
		border-radius: 50%;
	}

	.img13 {
		width: 100rpx;
		height: 100rpx;
		border-radius: 50%;
	}

	.img14 {
		width: 52rpx;
		height: 52rpx;
	}

	.img15 {
		width: 15rpx;
		height: 28rpx;
	}

	.img16 {
		width: 150rpx;
		height: 150rpx;
		border-radius: 10rpx;
	}

	.img17 {
		width: 246rpx;
		height: 160rpx;
	}

	.img18 {
		width: 30rpx;
		height: 30rpx;
	}

	.img19 {
		width: 98rpx;
		height: 98rpx;
		border-radius: 50%;
	}

	.img20 {
		width: 110rpx;
		height: 110rpx;
		border-radius: 50%;
	}

	.img21 {
		width: 54rpx;
		height: 54rpx;
	}

	.img22 {
		width: 42rpx;
		height: 42rpx;
	}

	.img23 {
		width: 56rpx;
		height: 56rpx;
	}

	.img24 {
		width: 63rpx;
		height: 63rpx;
		border-radius: 50%;
	}

	/* 底部菜单栏 */
	.bottom_nav {
		position: fixed;
		left: 0;
		bottom: 0;
		width: 100%;
		padding: 15rpx 0;
		height: 98rpx;
		text-align: center;
		background-color: #fff;
		line-height: 1;
		font-size: 24rpx;
		color: #1B1B1B;
		box-shadow: 0px 0px 13rpx 0px rgba(45, 45, 45, 0.14);
		z-index: 3;
	}

	.recruit_img_pos {
		position: absolute;
		top: -70rpx;
		left: 50%;
		width: 118rpx;
		height: 118rpx;
		z-index: 2;
		transform: translateX(-50%);
	}

	.menu_content_box {
		position: relative;
		height: calc(100vh - 98rpx);
		overflow-y: auto;
	}

	.box {
		line-height: 1;
	}

	/* 筛选弹窗 */
	.screen_bomb_fix {
		display: none;
		position: fixed;
		top: 0;
		left: 0;
		width: 100%;
		height: 100vh;
		overflow: hidden;
		z-index: 99;
	}

	.screen_bomb_fix .mask_bg {
		position: absolute;
		top: 0;
		left: 0;
		width: 100%;
		height: 100%;
		background: rgba(0, 0, 0, .49);
		z-index: 1;
	}

	.screen_bomb_fix .screen_popup_box,
	.screen_bomb_fix .screen_popup_box_2 {
		position: relative;
		width: 600rpx;
		height: 100%;
		background-color: #F9F8F8;
		overflow: hidden;
		margin-left: auto;
		margin-right: 0;
		z-index: 2;
	}

	.screen_bomb_fix .screen_popup_box_2 {
		position: absolute;
		left: 0;
		bottom: 0;
		width: 100%;
		height: auto;
		margin-left: auto;
		margin-right: auto;
		border-radius: 40rpx 40rpx 0 0;
	}

	.show.screen_bomb_fix {
		display: block;
	}

	.screen_content {
		position: relative;
		top: 40rpx;
		height: calc(100vh - 150rpx);
		padding: 20rpx;
		overflow-y: auto;
		background-color: #f9f8f8;
	}

	.screen_content_2 {
		position: relative;
		height: 636rpx;
		overflow-y: auto;
		padding-bottom: 35rpx;
	}

	.type_tab,
	.unlimited_box,
	.type_tab_max {
		display: inline-flex;
		padding: 0 20rpx;
		height: 50rpx;
		align-items: center;
		font-size: 25rpx;
		font-weight: 500;
		color: #5D5D5D;
		background-color: #F0F0F0;
		border: 1px solid #F0F0F0;
		border-radius: 16rpx;
		margin-top: 28rpx;
		margin-right: 30rpx;
	}

	.unlimited_box {
		padding: 0 30rpx;
	}

	.type_tab_max {
		width: 111rpx;
		padding: 0;
		height: 110rpx;
		justify-content: center;
		flex-direction: column;
	}

	.active.type_tab,
	.active.unlimited_box,
	.active.type_tab_max {
		color: #FF2A2A;
		background-color: #FEE2E2;
		border-color: #FBB9B9;
	}

	.price_range_ipt {
		display: inline-flex;
		width: 100%;
		height: 50rpx;
		align-items: center;
		justify-content: center;
		text-align: center;
		font-size: 25rpx;
		color: #5D5D5D;
		background-color: #F0F0F0;
		border-radius: 16rpx;
		outline: none;
		border: none;
	}

	.hor_line_1 {
		display: block;
		width: 34rpx;
		height: 1px;
		background-color: #f0f0f0;
	}

	.content_label_area {
		display: none;
	}

	.active.content_label_area {
		display: block;
	}

	.screen_bottom_area {
		display: flex;
		height: 98rpx;
		background-color: #fff;
		border-top: 1px solid #e9e8e8;
		box-shadow: 0 0 20rpx #e9e8e8;
		margin-top: 52rpx;
	}

	.reset_btn,
	.determine_btn {
		display: inline-flex;
		width: 176rpx;
		height: 66rpx;
		align-items: center;
		justify-content: center;
		font-size: 28rpx;
		border-radius: 33rpx;
	}

	.reset_btn {
		color: #656565;
		background-color: #eee;
	}

	.determine_btn {
		color: #fff;
		background-image: linear-gradient(to right, #ff8c39, #ff3718);
	}

	.ipt_search_screen {
		display: inline-block;
		width: 100%;
		padding: 0 15rpx 0 69rpx;
		height: 58rpx;
		line-height: 58rpx;
		font-size: 26rpx;
		text-align: left;
		color: #000;
		background-color: #fff;
		outline: none;
		border: none;
		vertical-align: top;
		border-radius: 29rpx;
	}

	.icon_search_pos_screen {
		position: absolute;
		top: 15rpx;
		left: 27rpx;
		width: 28rpx;
		height: 28rpx;
		z-index: 2;
	}

	.region_box_sty {
		font-size: 26rpx;
		color: #353535;
		background-color: #fff;
		border-radius: 16rpx;
	}

	/* 筛选弹窗 */
	radio,
	checkbox {
		-webkit-transform: scale(0.7);
		transform: scale(0.7);
	}
</style>


